package com.setruth.mvvmbaseproject.network.api

import com.google.gson.JsonObject
import com.setruth.mvvmbaseproject.network.response.BaseResponse

import com.test.resumeanalysis.data.model.JobInfo
import com.test.resumeanalysis.data.model.UpLoadBean
import com.test.resumeanalysis.data.model.UserBean
import com.test.resumeanalysis.data.model.resume.ResumeParse
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Query

interface TestAPI {
    /**
     * TODO 登录请求
     *
     * @param requestBody
     * @return
     */
    @POST("/userlogin")
     fun login(@Query("username")username:String,@Query("password")password:String): Call<BaseResponse<UserBean>>
}

interface ResumeParseApi{

    @Headers("id:0aa5c8e0-f08f-11ed-9366-2193875054cd",
        "secret:083221d4-0c1b-40bc-84fc-60667185ea34"
    )
    @POST("/v1/parser/parse_base")
        fun Parse(@Query("rawtext")rawtext:String="0",@Query("handle_image")handle_image:String="1",
                  @Query("avatar")avatar:String="0",@Query("parse_mode")parse_mode:String="general",
                  @Query("ocr_mode")ocr_mode:String="general",@Query("ocr_service")ocr_service:String="alicloud",
                  @Body json: JsonObject
    ): Call<ResumeParse>
}

interface JobInfoApi{

    @GET("api/JobInfo/getAllJob")
    fun getAllJob():Call<BaseResponse<List<JobInfo>>>
}

interface UpLoadAPi{
    @POST("/api/upload/uploadFile")
    fun uploadFile(@Body base64File: UpLoadBean):Call<BaseResponse<String>>
}